{template 'common/header'}
{template 'web/template/navs'}
<style>
    .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {overflow: visible !important;}
    .dropdown-menu{min-width:4em;}
    .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {white-space: normal !important;overflow: visible !important;}
    .dropdown{display:inline-block !important;}
</style>

<div class="panel panel-default">
    <div class="panel-heading">
        <ul class="nav nav-tabs">
            <li {if empty($_GPC['position'])}class="active"{/if}>
                <a href="{php echo $this->createWebUrl('navs')}">全部</a>
            </li>
        	<li {if $_GPC['position']=="user"}class="active"{/if}>
        		<a href="{php echo $this->createWebUrl('navs',array('position'=>'user'))}">客户端</a>
        	</li>
            <li {if $_GPC['position']=="runner"}class="active"{/if}>
                <a href="{php echo $this->createWebUrl('navs',array('position'=>'runner'))}">服务端</a>
            </li>
            <li {if $_GPC['position']=="user_home"}class="active"{/if}>
                <a href="{php echo $this->createWebUrl('navs',array('position'=>'user_home'))}">个人中心</a>
            </li>
            <li {if $_GPC['position']=="runner_home"}class="active"{/if}>
                <a href="{php echo $this->createWebUrl('navs',array('position'=>'runner_home'))}">跑腿中心</a>
            </li>
        </ul>
    </div>
    <div class="panel-body">
        <table st-table="items" class="table table-striped table-condensed" style="display:auto;">
            <thead>
            <tr>
                <th style="width:12em;">显示顺序</th>
                <th style="width:8em;">导航标题</th>
                <th style="width:30em;">导航链接</th>
                <th style="width:6em;">导航图标</th>
                <th style="width:5em;">位置</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {loop $list['list'] $li}
            <tr>
                <td>{$li['displayorder']}</td>
                <td>{$li['title']}</td>
                <td>{$li['link']}</td>
                <td><i class="{php echo $li['icon']}"></i></td>
                <td>
                    <label for="" class="label label-info">
                        {if $li['position']=='user'}
                            客户端
                        {else if $li['position']=='runner'}
                            服务端
                        {else if $li['position']=='runner_home'}
                            跑腿中心
                        {else if $li['position'] == 'user_home'}
                            用户中心
                        {/if}
                    </label>
                </td>
                <td>
                    <a href="{php echo $this->createWebUrl('navs',array('act'=>'edit','position'=>$position,'id'=>$li['id']))}" class="btn btn-default">编辑</a>
                    <a href="{php echo $this->createWebUrl('navs',array('act'=>'delete','position'=>$position,'id'=>$li['id']))}" class="btn btn-danger">删除</a>
                </td>
            </tr>
            {/loop}
            </tbody>
        </table>
        {php echo $list['pager']}
    </div>
    <div class="panel-footer">
        <a href="{php echo $this->createWebUrl('navs',array('act'=>'edit','position'=>$position))}" class="btn btn-default">新增</a>
        {if !empty($position)}
        <a href="{php echo $this->createWebUrl('onekey',array('act'=>$position))}" class="btn btn-success">一键配置</a>
        {/if}
    </div>
</div>
{template 'common/footer'}